const directives = require.context("./modules", true, /\.js$/);

export default {
    install: (Vue) => {
        directives.keys().forEach((key) => {
            let directive = directives(key).default;
            let name = key.replace(/^\.\/(.*)\.\w+$/, "$1");
            directive && Vue.directive(name, directive);
        });
    },
};

